package com.example.association2.controller;

import com.example.association2.model.MyAssociationDTO;
import com.example.association2.repository.AssociationMemberRepository;
import com.example.association2.repository.AssociationRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Slf4j
@RequestMapping
@Controller
public class atest {

    @Autowired
    private AssociationRepository associationRepository;

    @Autowired
    private AssociationMemberRepository associationMemberRepository;

//    @RequestMapping("/1")
//    public String sss(){
//        log.info("1111");
//        List<MyAssociationDTO> a = new ArrayList<>();
//        associationMemberRepository.addMember();
//        return "1";
//    }


    @RequestMapping("/2")
    public String ss1s(){
        log.info("2222");
        List<MyAssociationDTO> a = new ArrayList<>();
        a =  associationRepository.MyAssociation(1);
        log.info("{}",a);
        return "c";
    }
}
